<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <title>{$title}</title>
        <style>
            * { margin: 0; padding: 0; }
            body {
                font-family: "Microsoft YaHei", Arial, sans-serif;
                background: #f8f9fa;
                color: #333;
                line-height: 1.6;
            }
            .wrapper {
                position: fixed;
                top: 50%;
                left: 50%;
                transform: translate(-50%, -50%);
                width: 460px;
                background: #fff;
                border-radius: 4px;
                box-shadow: 0 1px 3px rgba(0,0,0,.1);
            }
            .header {
                height: 48px;
                line-height: 48px;
                padding: 0 20px;
                font-size: 16px;
                color: #fff;
                border-radius: 4px 4px 0 0;
            }
            .success .header {
                background: #409eff;
            }
            .error .header {
                background: #f56c6c;
            }
            .body {
                padding: 30px 20px;
                text-align: center;
            }
            .message {
                font-size: 15px;
                margin-bottom: 20px;
            }
            .redirect {
                color: #666;
                font-size: 14px;
            }
            .redirect a {
                color: #409eff;
                text-decoration: none;
            }
            .redirect a:hover {
                color: #66b1ff;
            }
            .timer {
                color: #409eff;
                font-weight: bold;
                margin: 0 3px;
            }
            @media (max-width: 480px) {
                .wrapper {
                    width: 90%;
                    margin: 0 20px;
                }
            }
        </style>
    </head>
    <body>
        <div class="wrapper {$type}">
            <div class="header">{$title}</div>
            <div class="body">
                <div class="message">{$msg}</div>
                <div id="jump" class="redirect">
                    页面将在 <span id="wait" class="timer">{$time}</span> 秒后自动 <a id="href" href="{$url}">跳转</a>
                </div>
            </div>
        </div>
        <script>
        (function(){
            var wait = document.getElementById('wait'),
                href = document.getElementById('href').href;
            if((self != top && href == parent.location.href) || href == location.href){
                document.getElementById('jump').style.display = 'none';
                return;
            }
            var interval = setInterval(function(){
                var time = --wait.innerHTML;
                if(time <= 0) {
                    clearInterval(interval);
                    location.href = href;
                }
            }, 1000);
        })();
        </script>
    </body>
</html> 